package com.dfl.gankio.base

import android.os.Bundle
import com.dfl.gankio.extend.obtainViewModel
import com.qmuiteam.qmui.arch.QMUIActivity

abstract class BaseActivity<VM : BaseViewModel> : QMUIActivity() {

    protected lateinit var viewModel: VM

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        viewModel = obtainViewModel(getViewModelClass())
        initView()
        initData()
    }


    abstract fun initView()

    abstract fun initData()

    abstract fun getViewModelClass(): Class<VM>
}